
Types = require('mongoose').Schema.Types

worker = require('./shared/columns').worker

module.exports = (ose) ->
  fields =
    name:
      type: String
      default: 'unnamed'
    worker: worker
    param: Types.Mixed
    status:
      type: String
      default: 'doing'
      validate: (v) -> v in ['doing', 'done']
    result: Types.Mixed
  opts =
    id: no
    collection: 'task'
  ose.Schema fields, opts

